﻿@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>CodeFirst</title>
    @RenderPage(Url.Content("~/Views/StealerHeader.cshtml"))
</head>
<body>
    <!--Layout-->
    <div id="layout1" class="mini-layout" style="width: 100%; height: 100%;">
        @*<div class="header" region="north" height="80" showsplit="false" showheader="false" style="background-color:#e9edf1;  ">
        </div>*@
        @*<div title="south" region="south" showsplit="false" showheader="false" height="30" style="text-align: center; height: 30px; line-height: 30px;">
           Copyright © Dita
        </div>*@
        <div title="center" region="center" bodystyle="border:0;">
            <!--Splitter-->
            <div class="mini-splitter" style="width: 100%; height: 100%;" borderstyle="border:0;">
                <div size="180" maxsize="250" minsize="100" showcollapsebutton="true">
                    <!--OutlookTree-->                 
                    <div id="leftTree" class="mini-outlooktree" url="/Content/Data-text/Menus.txt" onnodeclick="onNodeClick"
                         textfield="text" idfield="id" parentfield="pid" borderstyle="border:0;">
                    </div>
                </div>
                <div showcollapsebutton="false">
                    <!--Tabs-->
                    <div id="mainTabs" class="mini-tabs bg-toolbar" activeindex="0" style="width: 100%; height: 100%; "
                         bodystyle="border:0;background:white;" maskonload="false" contextmenu="#tabsMenu">
                        <div title="欢迎" url="/Home/ZXBGlistView" name="welcomepage"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <ul id="tabsMenu" class="mini-contextmenu" onbeforeopen="onBeforeOpen">
        <li onclick="closeTab">关闭标签页</li>
        <li onclick="closeAllBut">关闭其他标签页</li>
        <li onclick="closeAll">关闭所有标签页</li>
    </ul>
    <script type="text/javascript">
        mini.parse();
        function showTab(node) {
            var tabs = mini.get("mainTabs");
            var id = "tab$" + node.id;
            var tab = tabs.getTab(id);
            if (!tab) {
                tab = {};
                tab.name = id;
                tab.title = node.text;
                tab.showCloseButton = true;
                tab.url = node.url;
                tabs.addTab(tab);
            }
            tabs.activeTab(tab);
        }

        function onNodeClick(e) {
            var node = e.node;
            var isLeaf = e.isLeaf;

            if (isLeaf) {
                showTab(node);
            }
        }

        function logOut() {
            mini.confirm("确定退出系统？", "确定？", function (action) {
                if (action == "ok") {
                    $.post("/Login/LogOut", {}, function (d) {
                        if (d == "ok")
                            location.href = "/Login/LoginView";
                    });
                }
            })

        }

        var currentTab = null;
        function onBeforeOpen(e) {
            var tabs = mini.get("mainTabs");
            currentTab = tabs.getTabByEvent(e.htmlEvent);
            if (!currentTab) {
                e.cancel = true;
            }
        }
        function closeTab() {
            var welcome = mini.get("mainTabs").getTab("welcomepage");
            if (welcome != currentTab) {
                mini.get("mainTabs").removeTab(currentTab);
            }
        }
        function closeAllBut() {
            var but = [currentTab];
            but.push(mini.get("mainTabs").getTab("welcomepage"));
            mini.get("mainTabs").removeAll(but);
        }
        function closeAll() {
            var but = mini.get("mainTabs").getTab("welcomepage");
            mini.get("mainTabs").removeAll(but);
        }
    </script>
</body>
</html>
